{extend name="admin/base" /}
{block name="main"}
<div class="set-style">
	<dl>
		<dt>店铺等级:</dt>
		<dd>
			<p>{$shop_info['instance_type_info']['type_name']}</p>
		</dd>
	</dl>
	<dl>
		<dt>店铺名称:</dt>
		<dd>
			<p>{$shop_info['base_info']['shop_name']}</p>
		</dd>
	</dl>
	<dl>
		<dt>店铺类型:</dt>
		<dd>
			<p>{$shop_info['group_info']['group_name']}</p>
		</dd>
	</dl>
	<dl>
		<dt>店铺logo:</dt>
		<dd>
			<div class="class-logo"><p><img id="imgLogo"src="__UPLOAD__/{$shop_info['base_info']['shop_logo']}" ></p></div>
			<div class="ncsc-upload-btn"> 
			    <a href="javascript:void(0);"><span>
			          <input hidefocus="true" size="1" class="input-file" name="file_upload" id="uploadImg" nc_type="change_store_label" type="file" onchange="imgUpload(this);">
			        <input type="hidden"id="Logo"value="{$shop_info['base_info']['shop_logo']}"/></span><p><!-- <i class="icon-upload-alt"></i> -->上传图片</p>
			    </a> 
			</div>
			<p class="hint"><br><span style="color:orange;">建议使用宽600像素-高60像素内的GIF或PNG透明图片；点击下方"提交"按钮后生效。</span></p>
		</dd>
	</dl>
	<dl>
		<dt>横幅:</dt>
		<dd>
			<div class="class-logo"><p style="width: 600px;"><img id="imgLogo1"src="__UPLOAD__/{$shop_info['base_info']['shop_banner']}" ></p></div>
			<div class="ncsc-upload-btn"> 
			    <a href="javascript:void(0);"><span>
			          <input hidefocus="true" size="1" class="input-file" name="file_upload" id="uploadImg1" nc_type="change_store_label" type="file" onchange="imgUpload(this);">
			        <input type="hidden"id="Logo1"value="{$shop_info['base_info']['shop_banner']}"/></span><p><!-- <i class="icon-upload-alt"></i> -->上传图片</p>
			    </a> 
			</div>
			<p class="hint"><br><span style="color:orange;">建议使用宽600像素-高60像素内的GIF或PNG透明图片；点击下方"提交"按钮后生效。</span></p>
		</dd>
	</dl>
	<dl>
		<dt>店铺头像:</dt>
		<dd>
			<div class="class-logo"><p><img id="imgLogo2"src="__UPLOAD__/{$shop_info['base_info']['shop_avatar']}" ></p></div>
			<div class="ncsc-upload-btn"> 
			    <a href="javascript:void(0);"><span>
			          <input hidefocus="true" size="1" class="input-file" name="file_upload" id="uploadImg2" nc_type="change_store_label" type="file" onchange="imgUpload(this);">
			        <input type="hidden"id="Logo2"value="{$shop_info['base_info']['shop_avatar']}"/></span><p><!-- <i class="icon-upload-alt"></i> -->上传图片</p>
			    </a> 
			</div>
			<p class="hint"><br><span style="color:orange;">建议使用宽600像素-高60像素内的GIF或PNG透明图片；点击下方"提交"按钮后生效。</span></p>
		</dd>
	</dl>
	<dl>
		<dt>QQ:</dt>
		<dd>
			<p><input name="UserCode" id="shop_qq" type="text" value="{$shop_info['base_info']['shop_qq']}"> </p>
			<p class="error">请输入qq</p>
		</dd>
	</dl>
	<dl>
		<dt>阿里旺旺:</dt>
		<dd>
			<p><input name="UserCode" id="shop_ww" type="text" value="{$shop_info['base_info']['shop_ww']}"> </p>
			<p class="error">请输入阿里旺旺</p>
		</dd>
	</dl>
	<dl>
		<dt>商家电话:</dt>
		<dd>
			<p><input name="UserCode" id="shop_phone" type="text" value="{$shop_info['base_info']['shop_phone']}"> </p>
			<p class="error">请输入商家电话</p>
		</dd>
	</dl>
	<dl>
		<dt>seo关键字:</dt>
		<dd>
			<p><input name="UserCode" id="shop_keywords" type="text" value="{$shop_info['base_info']['shop_keywords']}"> </p>
			<p class="error">请输入seo关键字</p>
		</dd>
	</dl>
	<dl>
		<dt>seo描述:</dt>
		<dd>
			<p><textarea id="shop_description">{$shop_info['base_info']['shop_description']}</textarea> </p>
			<p class="error">请输入seo描述</p>
		</dd>
	</dl>
	<button class="edit_button" onclick="setShopConfigAjax();">提交</button>
</div>
<script src="ADMIN_JS/ajax_file_upload.js" type="text/javascript"></script>
<script src="__STATIC__/js/file_upload.js" type="text/javascript"></script>
<script>
function setShopConfigAjax(){
	var shop_logo = $("#Logo").val();
	var shop_banner = $("#Logo1").val();
	var shop_avatar = $("#Logo2").val();
	var shop_qq = $("#shop_qq").val();
	var shop_ww = $("#shop_ww").val();
	var shop_phone = $("#shop_phone").val();
	var shop_keywords = $("#shop_keywords").val();
	var shop_description = $("#shop_description").val();
	$.ajax({
		type:"post",
		url:"{:__URL('ADMIN_MAIN/Shop/shopConfig')}",
		data:{
			'shop_logo':shop_logo,
			'shop_banner':shop_banner,
			'shop_avatar':shop_avatar,
			'shop_qq':shop_qq,
			'shop_ww':shop_ww,
			'shop_phone':shop_phone,
			'shop_keywords':shop_keywords,
			'shop_description':shop_description
		},
		async:true,
		success:function (data) {
			if (data["code"] > 0) {
				showMessage('success', data["message"],"{:__URL('ADMIN_MAIN/Shop/shopConfig')}");
			}else{
				showMessage('error', data["message"]);
			}	
		}
	});
}
/**
 *图片上传
 */
function imgUpload(event) {
	var fileid = $(event).attr("id");
	var str = $(event).next().attr("id");
	var data = { 'file_path' : UPLOADCOMMON };
	uploadFile(fileid,data,function(res){
		if(res.code){
			$("#img"+str).attr("src","__UPLOAD__/"+res.data);
			$("#"+str).val(res.data);
			showTip(res.message,"success");
		}else{
			showTip(res.message,"error");
		}
	});
}
</script>

{/block}